package com.yuanye.gwcit.fragments;

import com.elvishew.xlog.XLog;
import com.yuanye.gwcit.GW;
import com.yuanye.gwcit.utils.GT;
import com.yuanye.yeecho.base.CommonTaskFragment;

public class SnCheckFragment extends CommonTaskFragment {

    public SnCheckFragment() {
        setTaskName("SN校验");
    }

    @Override
    public void execTask() {
        super.execTask();
        String input_sn, device_sn;
        input_sn = GW.cfgPcba.getSnInput();
        device_sn = GT.getBoardSn();
        appendLog("扫码SN: "+input_sn + "\n主板SN: "+device_sn);
        if (input_sn.equals(device_sn)){
            appendLog("比对成功\n");
            passAndNext();
        }else{
            appendLogF("比对失败");
            setFail();
        }

    }

    @Override
    protected void appendLog(String info) {
        super.appendLog(info);
        XLog.d(info);
    }
}
